//
//  BuyViewController.m
//  MyLottery
//
//  Created by wpapple on 16/5/25.
//  Copyright © 2016年 wpapple. All rights reserved.
//

#import "BuyViewController.h"

@interface BuyViewController ()

@property (nonatomic,strong) UIView *menuView;

@end

@implementation BuyViewController

-(UIView *)menuView
{
    if (!_menuView) {
        _menuView = [[UIView alloc]init];
        
        _menuView.frame = CGRectMake(0, 64, 300, 200);
        _menuView.center = self.view.center;
        _menuView.y = 64;
        [_menuView setBackgroundColor:[UIColor blueColor]];
        
        [self.view addSubview:_menuView];
    }
    return _menuView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.menuView.height = 0;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)menuBtnClicked:(UIButton *)sender {
    
    [UIView animateWithDuration:0.5 animations:^{
        
        if (CGAffineTransformIsIdentity(sender.imageView.transform)) {
            sender.imageView.transform = CGAffineTransformMakeRotation(M_PI);
            
            self.menuView.height = 200;
        }else
        {
            sender.imageView.transform = CGAffineTransformIdentity;
            
            self.menuView.height = 0;
        }
        
    }];
    
}


@end
